package com.wei.str;

/**
 * @Author :sunwei
 * @Description:
 * @Date create in 22:50  2021/4/5
 * @Modified by:
 */
public class StringInternTest {

    public static void main(String[] args) {
        String s1 = new String("1");
        s1.intern();
        String s2 = "1";

        System.out.println(s1==s2);

        String s3 = new String("1")+new String ("2");
        s3.intern();
        String s4 = "12";

        System.out.println(s3==s4);
    }
}
